Release 10.1A: OpenEdge Development:
Web Services


Running an internal procedure or user-defined function

Methods to run a Progress internal procedure and user-defined function of a persistent procedure (ProcObject) are indistinguishable in client code. These methods:

This is the Progress 4GL prototype for the sample user-defined function, GetTotalOrdersByNumber( ):

Progress 4GL prototype for a user-defined function
/* CustomerOrder.p */ 
FUNCTION GetTotalOrdersByNumber RETURNS INTEGER 
   (Threshold AS DECIMAL):  

This is a VB.NET declaration for the Progress user-defined function method, GetTotalOrdersByNumber( ):

VB.NET prototype for a Progress user-defined function method
Public Function GetTotalOrdersByNumber 
                   (ByVal Threshold As Decimal) As Integer 

The following is a sample method call for the user-defined function method, GetTotalOrdersByNumber, which is an interface method on the sample ProcObject, CustomerOrder:

VB.NET client code of method to run a Progress user-defined function
totNumber = custOrder.GetTotalOrdersByNumber(2150.99) 

Note that user-defined function methods return a value whose data type maps to the Progress data type of the user-defined function’s return value.

This is a sample RPC/Encoded SOAP request that might be generated from invoking the GetTotalOrdersByNumber( ) method to execute the Progress user-defined function, passing in a Threshold order value of 2150.99:

SOAP request for user-defined function method, GetTotalOrdersByNumber
<?xml version="1.0" encoding="utf-8" ?> 
<soap:Envelope namespaces defined here...> 
  <soap:Header> 
    <q1:CustomerOrderID id="h_id1" xmlns:q1="urn:OrderSvc:CustomerOrder"> 
         <UUID xsi:type="xsd:string">2e62cab6b81150d5:167f64e:f295e997b0: 
         -8000;<OrderInfo|PX-000002|PO>;G1Vc/vmohvLnwxQQXwA6Cg==</UUID> 
    </q1:CustomerOrderID> 
  </soap:Header> 
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <q1:GetTotalOrdersByNumber xmlns:q1="OrderSvc:CustomerOrder"> 
      <Threshold xsi:type="xsd:decimal">2150.99</Threshold> 
    </q1:GetTotalOrdersByNumber> 
  </soap:Body> 
</soap:Envelope> 

Note the object ID for the ProcObject, CustomerOrder, sent to make the request on a method of the ProcObject.

This is the SOAP response returning a function value of 5, which is the total number of orders that satisfy the specified order Threshold value:

SOAP response from calling the GetTotalOrdersByNumber method
<?xml version="1.0" encoding="UTF-8" ?> 
<soap:Envelope namespaces defined here...> 
  <soap:Body> 
    <ns1:GetTotalOrdersByNumberResponse 
         xmlns:ns1="urn:OrderSvc:CustomerOrder" 
         soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
      <result xsi:type="xsd:int">5</result> 
    </ns1:GetTotalOrdersByNumberResponse> 
  </soap:Body> 
</soap:Envelope> 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095